package com.yolo.example.consumer;


import com.yolo.example.common.model.User;
import com.yolo.example.common.serivce.UserService;
import yolorpc.config.RpcConfig;
import yolorpc.proxy.ServiceProxyFactory;
import yolorpc.utils.ConfigUtils;


/**
 * @Program: RPC
 * @description: 简易服务消费者示例
 * @author: yolo
 * @create: 2025-04-18 16:07
 **/
public class EasyConsumerExample {
    public static void main(String[] args) {

        // 动态代理
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);

        User user = new User();
        user.setName("yolo");
        // 调用
        User userServiceUser = userService.getUser(user);
        if (userServiceUser != null){
            System.out.println(userServiceUser.getName());
        } else {
            System.out.println("user == null");
        }
    }
}
